package com.hjsmallfly.syllabus.ext

import rx.Observable
import rx.android.schedulers.AndroidSchedulers

fun <T> Observable<T>.from_computation(): Observable<T> = this.subscribeOn(rx.schedulers.Schedulers.computation())

fun <T> Observable<T>.from_io(): Observable<T> = this.subscribeOn(rx.schedulers.Schedulers.io())

fun <T> Observable<T>.from_ui(): Observable<T> = this.subscribeOn(AndroidSchedulers.mainThread())

fun <T> Observable<T>.to_ui(): Observable<T> = this.observeOn(rx.android.schedulers.AndroidSchedulers.mainThread())

fun <T> Observable<T>.to_io(): Observable<T> = this.observeOn(rx.schedulers.Schedulers.io())

fun <T> Observable<T>.to_computation(): Observable<T> = this.observeOn(rx.schedulers.Schedulers.computation())

